package factorymethod.impl.factory;
import factorymethod.impl.product.Product;


public class CommonFactory extends Factory {

	@Override
	public Product factoryMethod() {
		return null;
	}

	@Override
	public Product factoryMethod(Class<? extends Product> c) {
		Product product=null;
		try 
		{
		     product = (Product)Class.forName(c.getName()).newInstance();
	    } 
		catch (Exception e)
		{
		     System.out.println("反射生成错误！");
		}
		return product;
		 
   }

}
